<!DOCTYPE html>
<html>
<head>
    <title>益多多回收</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
    <style type="text/css">
		body,html{background: #e4e4e4;}
		.xyg-search{width: 96%; height: auto; padding: 0px 2%; background:#09C15F;}
	  .xyg-search .xyg-search-left{width:30%; height:100px;line-height:100px; text-align:center;color: #ffffff;float: left;}
	  .xyg-search .xyg-search-right{width:70%; height: 100px;float: left;}
	   .xyg-search .xyg-search-right .xyg-search-right-content{width:90%; height:70px;border-radius: 15px; margin:15px; background: #ffffff;}
	  .xyg-search-right-content-icon{width: 5%; float: left; text-align: center; height: 60px; padding:10px 5% 5px 2%;}
	  .xyg-search .xyg-search-right input{width:85%;height: 70px;border-radius: 15px;line-height:70px;background-color: transparent; font-size:28px;color: #999999;border: 0;background: #ffffff;float: left; padding-left:3%;}
	  
	.xyg-list{width:96%;height:auto; margin:0.5rem 2%;}
  	.xyg-list .xyg-list-item{width:98%;height:260px;padding:0.5rem 1%; margin-bottom:0.5rem; background:#ffffff;border-radius:10px; }
  	.xyg-list .xyg-list-item .xyg-list-item-pic{width:35%;height:260px; float:left;}
	.xyg-list .xyg-list-item .xyg-list-item-pic img{width:auto;height:260px; margin:0px auto; max-width:96%;}
	.xyg-list .xyg-list-item .xyg-list-item-content{width:63%;height:260px; margin-left:2%; float:left;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-title{width:100%;height:60px; font-size:32px; font-weight:bold; color:#000;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-line{width:100%;height:50px; line-height:50px; font-size:28px;color:#999;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-btn{width:100%;height:50px;}
	.xyg-list .xyg-list-item .xyg-list-item-content .xyg-list-item-content-btn .xyg-list-item-content-btn-title{width:160px;height:50px;line-height:50px; font-size:28px; color:#09C15F; border-radius:20px; text-align:center; border:1px solid #09C15F;float: right; margin-right:1rem;}
    </style>
</head>
<body>

<div class="xyg-list" id="showList">

</div>

<div class="xyg-product-list_loadmore weui-loadmore clearBoth">
  <i class="weui-loading"></i>
  <span class="weui-loadmore__tips">正在加载</span>
</div>

</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/js/iscroll.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/js/component.js"></script>
<script src="${s.base}/mobile/js/base.js"></script>
<script type="text/javascript">
    var memberId = '${memberId}';

    var pageStart=0;
    var num=10;
    var loading = false;  //状态标记
    sendPost();
    $(document).ready(function(e) {
        initPage();
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            sendPost();
        });
    });

    function initPage() {
        $(document.body).infinite();
        $(".xyg-product-list_loadmore").show();
    }

    function sendPost() {
        $("#showContent").hide();
        pageStart++;
        $.post("/phone/shopOrderJsonList",{
            pageSize : num,
            pageNum : pageStart,
            memberId : memberId,
            removeTag:"1"
        },function(resultInfo){
            if (resultInfo.data!=null && resultInfo.data.length > 0){
                for(var j=0;j<resultInfo.data.length;j++){
                    var shopOrder = resultInfo.data[j];
                    var statusCss = "";
                    if (shopOrder.status == "1") {
                        statusCss = "处理中";
                    } else if (shopOrder.status == "2") {
                        statusCss = "已通过";
                    } else if (shopOrder.status == "3") {
                        statusCss = "未通过";
                    }
                    var str='<div class="xyg-list-item">\
                        <div class="xyg-list-item-pic">\
                        <img src="'+shopOrder.image+'" style="width: 96%; height: 100%;" /></div>\
                        <div class="xyg-list-item-content">\
                        <div class="xyg-list-item-content-title font-grade-one">'+shopOrder.itemName+'</div>\
                    <div class="xyg-list-item-content-line">积分：'+shopOrder.integral+'</div>\
                    <div class="xyg-list-item-content-line">状态：'+statusCss+'</div>\
                    <div class="xyg-list-item-content-btn">\
                        <div class="xyg-list-item-content-btn-title" onclick="goShopOrderShowPage(\''+memberId+'\',\''+shopOrder.id+'\')">查看详情</div></div>\
                    </div>\
                    <div class="clearBoth"></div>\
                        </div>';


                    $("#showList").append(str);
                    loading = false;
                    if(!resultInfo.hasNextPage){
                        $(document.body).destroyInfinite();
                        $(".xyg-product-list_loadmore").hide();
                    }
                }
            }else{
                $(document.body).destroyInfinite();
                $(".xyg-product-list_loadmore").hide();
            }

        },"json");
    }
</script>
</html>
